-- GENERATED SPELL FOR [Mad Scientist] --


function spell0_16020(pUnit, Event) --@Great Heal,Heal--
pUnit:FullCastSpellOnTarget(28306,pUnit)
pUnit:RegisterEvent('Sorts_16020', 2000, 1)
end

function spell1_16020(pUnit, Event) --@Great Heal,Heal--
pUnit:FullCastSpellOnTarget(54337,pUnit)
pUnit:RegisterEvent('Sorts_16020', 2000, 1)
end

function spell2_16020(pUnit, Event) --@Mana Burn,n/a--
pUnit:FullCastSpellOnTarget(28301,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16020', 2000, 1)
end

function spell3_16020(pUnit, Event) --@Mana Burn,n/a--
pUnit:FullCastSpellOnTarget(54338,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16020', 2000, 1)
end

function Sorts_16020(pUnit, Event)
local choix_sorts_16020 = math.random(0, 3)
if choix_sorts_16020 == 0 then
pUnit:RegisterEvent('spell0_16020', 1, 1)
end
if choix_sorts_16020 == 1 then
pUnit:RegisterEvent('spell1_16020', 1, 1)
end
if choix_sorts_16020 == 2 then
pUnit:RegisterEvent('spell2_16020', 1, 1)
end
if choix_sorts_16020 == 3 then
pUnit:RegisterEvent('spell3_16020', 1, 1)
end
end

function mob16020_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16020', math.random(1500, 3000), 1)
end

function mob16020_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16020_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16020_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16020, 1, 'mob16020_Action')
RegisterUnitEvent(16020, 2, 'mob16020_Leave')
RegisterUnitEvent(16020, 3, 'mob16020_Kill')
RegisterUnitEvent(16020, 4, 'mob16020_Die')
